// @ts-nocheck
import type { AppRouteRecordRaw } from '/@/router/types';
import { t } from '/@/hooks/web/useI18n';
import { WELCOME_NAME, REDIRECT_NAME, LAYOUT, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME } from '/@/router/constant';

// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
  id: PAGE_NOT_FOUND_NAME,
  path: '/:path(.*)*',
  name: PAGE_NOT_FOUND_NAME,
  component: LAYOUT,
  meta: {
    title: 'ErrorPage',
    hideBreadcrumb: true,
    hideMenu: true,
  },
  children: [
    {
      id: PAGE_NOT_FOUND_NAME,
      path: '/:path(.*)*',
      name: PAGE_NOT_FOUND_NAME,
      component: EXCEPTION_COMPONENT,
      meta: {
        title: 'ErrorPage',
        hideBreadcrumb: true,
        hideMenu: true,
      },
    },
  ],
};


export const WELCOME_ROUTE: AppRouteRecordRaw = {
  id: 'Welcome',
  path: '/welcome',
  name: 'Welcome',
  component: LAYOUT,
  redirect: '/welcome/user',
  meta: {
    title: t('routes.basic.welcome'),
  },

  children: [
    {
      id: WELCOME_NAME,
      path: 'user',
      name: WELCOME_NAME,
      component: () => import('/@/views/welcome/index.vue'),
      meta: {
        title: t('routes.basic.welcome')
      },
    },
  ],
};

export const REDIRECT_ROUTE: AppRouteRecordRaw = {
  id: 'RedirectTo',
  path: '/redirect',
  component: LAYOUT,
  name: 'RedirectTo',
  meta: {
    title: REDIRECT_NAME,
    hideBreadcrumb: true,
    hideMenu: true,
  },
  children: [
    {
      id: REDIRECT_NAME,
      path: '/redirect/:path(.*)',
      name: REDIRECT_NAME,
      component: () => import('/@/views/sys/redirect/index.vue'),
      meta: {
        title: REDIRECT_NAME,
        hideBreadcrumb: true,
      },
    },
  ],
};

export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
  id: 'ErrorLog',
  path: '/error-log',
  name: 'ErrorLog',
  component: LAYOUT,
  redirect: '/error-log/list',
  meta: {
    title: 'ErrorLog',
    hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      id: 'ErrorLogList',
      path: 'list',
      name: 'ErrorLogList',
      component: () => import('/@/views/sys/error-log/index.vue'),
      meta: {
        title: t('routes.basic.errorLogList'),
        hideBreadcrumb: true,
        currentActiveMenu: '/error-log',
      },
    },
  ],
};


// 账号页面
export const ACCOUNT_PAGE: AppRouteRecordRaw = {
  id: 'account',
  path: '/account',
  name: 'account',
  component: LAYOUT,
  redirect: '/account/userSetting',
  meta: {
    title: '账号中心',
    // hideBreadcrumb: true,
    hideChildrenInMenu: true,
  },
  children: [
    {
      id: 'account-setting',
      path: 'userSetting',
      name: 'account-setting',
      component: () => import('/@/views/system/userSetting/UserSetting.vue'),
      meta: {
        title: t('routes.basic.accountSetting'),
        // hideBreadcrumb: true
        hideMenu: true
      },
    },
  ],
};
